package com.biglead.orderservice.controller;

import com.biglead.common.pojo.OrderInfo;
import com.biglead.common.pojo.Result;
import com.biglead.orderservice.service.GoodsInfoService;
import com.biglead.orderservice.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Resource
    private GoodsInfoService goodsInfoService;

     @Value("${server.port}")
     private String serverPort;

    /**
     * @param goodsId 商品id
     * @return 用户
     */
    @GetMapping(value = "/loadRoRedis/{id}")
    public void queryById(@PathVariable("id") Long goodsId) {
        log.info("加载商品到redis中 port {}",serverPort);
         goodsInfoService.testRedisLoadGoods(goodsId);
    }

}
